//
//  NSObject+Tools.m
//  GC_OC
//
//  Created by  Quan He on 2022/4/10.
//

#import "NSObject+Tools.h"

@implementation NSObject (Tools)
- (BOOL)isNullObject {
    if (self == nil || [self isEqual:[NSNull null]]) {
        return YES;
    }
    if ([self isKindOfClass:[NSDictionary class]] || [self isKindOfClass:[NSMutableDictionary class]]) {
        NSDictionary *dic = (NSDictionary *)self;
        if (dic.count == 0){
            return YES;
        }else {
            return NO;
        }
    }
    
    if ([self isKindOfClass:[NSArray class]] || [self isKindOfClass:[NSMutableArray class]]) {
        NSArray *array = (NSArray *)self;
        if (array.count == 0){
            return YES;
        }else {
            return NO;
        }
    }
    
    if ([self isKindOfClass:[NSString class]] || [self isKindOfClass:[NSMutableString class]]) {
        NSString *string = [NSString stringWithFormat:@"%@",self];
        if (string.length == 0){
            return YES;
        }else {
            return NO;
        }
    }
    
    
    return NO;
}
@end
